﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Weather
{
    public partial class frmPrint : Form
    {
        public frmPrint()
        {
            InitializeComponent();
        }

        private List<string> m_GetPrintNames;
        public List<string> GetPrintNames
        {
            set
            {
                m_GetPrintNames = value;
                if (m_GetPrintNames.Count > 0)
                {
                    cbPrinterName.DataSource = m_GetPrintNames;
                    cbPrinterName.SelectedIndex = 0;
                }
            }
            get
            {
                return m_GetPrintNames;
            }
        }

        public string PrinterName
        {
            get
            {
                if (GetPrintNames != null && GetPrintNames.Count > 0 && cbPrinterName.SelectedIndex >= 0)
                {
                    return cbPrinterName.SelectedItem.ToString();
                }
                return string.Empty;
            }
        }

        private void btnPrint_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.OK;
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
        }
    }
}
